home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / e / mailinglists / amigae.0294feb.archive / 000091_donews!crash!w….std.com!cosell_Mon, 21 Feb 94 09:18:15 PST.msg < prev    next >
Internet Message Format  |  1994-05-26  |  7KB

  1. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  2.       id <1vuc@bkhouse.cts.com>; Mon, 21 Feb 94 09:18:15 PST
  3. Received: from crash by donews.cts.com with uucp
  4.     (Smail3.1.28.1 #18) id m0pYV6B-00005kC; Mon, 21 Feb 94 02:30 EST
  5. Received: from relay2.UU.NET by crash.cts.com with smtp
  6.     (Smail3.1.28.1 #18) id m0pYUmU-0000QDC; Sun, 20 Feb 94 23:10 PST
  7. Received: from world.std.com by relay2.UU.NET with SMTP 
  8.     (5.61/UUNET-internet-primary) id AAweee08491; Mon, 21 Feb 94 02:10:00 -0500
  9. Received: by world.std.com (5.65c/Spike-2.0)
  10.     id AA11072; Mon, 21 Feb 1994 02:10:00 -0500
  11. In-Reply-To: <9402182149.AA01661@plucky.safb.af.mil>
  12.          (from bwills@plucky.safb.af.mil (Barry D Wills))
  13.          (at Fri, 18 Feb 94 15:49:19 CST)
  14. X-Mailer: //\\miga Electronic Mail (AmiElm 2.253)
  15. Content-Length: 2838
  16. Date: Sunday, 20 February 1994 18:29 EST
  17. Organization: Fantasy Farm Fibers
  18. Message-Id: <5894:66590@fantasyfarm.com>
  19. From: bernie@fantasyfarm.com (Bernie Cosell)
  20. To: AmigaE@bkhouse.cts.com (The AmigaE Mailing List)
  21. Subject: Re: Bugs in the Mod() function
  22.  
  23. In <9402182149.AA01661@plucky.safb.af.mil> on Feb 18, Barry D Wills wrote:
  24.  
  25. } Sounds from your example like:
  26. }   WriteF('time=12: 15 hours later it's \d\n', Mod(15, 12))
  27. } writes:
  28. }   time=12: 15 hours later it's 3
  29. } I still don't see it.  Mod(12,12) = 0, just like the example.
  30.  
  31. Try
  32.    WriteF('time=12: 15 hours earlier it's \d\n', Mod(12-15, 12))
  33.  
  34.  
  35. } *B) } This will give weird results if c exceeds max-int.
  36. } *B) } Wouter likes it this way, so I made a function that
  37. } *B) } does 32bit modulo:
  38. } *B) } 
  39. } *B) }   PROC mod(this, bythat) RETURN this-Mul(bythat, Div(this, bythat))
  40. } *B) 
  41. } *B) Unfortunately it doesn't.  It returns the *remainder*.  Not the same
  42. } By any definition I am familiar with it does.  You better
  43. } hurry up and edumuhcate us before Wouter releases a
  44. } Compiler Authoring Tutorial and suddenly a hundred other
  45. } languages arise, all with a Mod function or operator that 
  46. } performs against your expectations. :-D
  47. } Ahem, sorry.  I couldn't resist the opportunity. :-)
  48.  
  49. OK, I'll try this slowly.  "modulo arithmetic" refers to a
  50. particular sort of arithmetic over a finite field.  In every
  51. mathematical context using the term, the concept of "modulo n"
  52. refers to operations over a field best modelled as the integers
  53. from (0, ..., n-1), where each 'integer' is actually an equivalence
  54. class: the member 'k' of the field is actually the equiv class of
  55. all integers of the form (k + x*n), for all integral x.  form a
  56. field with the arithmetic operations defined over the integers in
  57. the usual way. There are subtleties if you want to talk about 'n'
  58. being negative or fractional, but those aren't relevant for the
  59. current discussion.
  60.  
  61.  
  62. } *B) I've been trying to argue some _basic_ math into hardheaded hardware
  63. } *B) designers for almost 30 years now....
  64. } Preseverence!  Changing tradition, nearly impossible
  65. } sometimes.
  66.  
  67. At the least, I _might_ be able to get Wouter to change it from Mod()
  68. to Rem() or _at_least_ get the docs to say explictly that it implements
  69. nothing more than 'remainder' [regardless of what it is called]....
  70. not likely but it's a shot...
  71.  
  72. [I've given up hope of anyone actually *implementing* a real mod
  73. function, and so if I need to do modular arithmetic [as in the
  74. clock example] the only alternative is to do it brute-force [and
  75. the little expression you wrote above *doesn't* do it,
  76. unfortunately [yes, i did try that! it just gets you the remainder
  77. back again on most [but not all!] architectures]].
  78.  
  79. Real modular arithmetic is useful and it is really a shame that
  80. because of a bunch of EEs a long time ago not caring [or not knowing
  81. any better], computers now don't support it, when they trivially could.
  82. such is life..
  83.  
  84.   /Bernie\
  85. -- 
  86. Bernie Cosell                               bernie@fantasyfarm.com
  87. Fantasy Farm Fibers, Pearisburg, VA         (703) 921-2358
  88. From donews!crash!archimed.irit.fr!vintenat Tue, 22 Feb 94 01:33:19 PST
  89. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  90.       id <1vv2@bkhouse.cts.com>; Tue, 22 Feb 94 01:33:19 PST
  91. Received: from crash by donews.cts.com with uucp
  92.     (Smail3.1.28.1 #18) id m0pYXTq-0002SvC; Mon, 21 Feb 94 05:03 EST
  93. Received: from archimed.irit.fr by crash.cts.com with smtp
  94.     (Smail3.1.28.1 #18) id m0pYXQ9-0000V2C; Mon, 21 Feb 94 01:59 PST
  95. Received: from localhost (vintenat@localhost) by archimed.irit.fr (8.6.4/8.6.4) id LAA08101 for AmigaE@bkhouse.cts.com; Mon, 21 Feb 1994 11:02:37 GMT
  96. Date: Mon, 21 Feb 1994 11:02:37 GMT
  97. Message-Id: <199402211102.LAA08101@archimed.irit.fr>
  98. From: Lionel VINTENAT <vintenat@archimed.irit.fr>
  99. To: AmigaE@bkhouse.cts.com
  100. Subject: Re: v39 .m's
  101.  
  102.  
  103. >-> > BTW I'm trying to convert the AmigaDos 3.1 .i includes into .m
  104. >-> files > with IConvert.
  105. >-> >
  106. >-> > Needless to say, there are some .i files that don't want to work.
  107. >-> (eg. > exec/ables.i or exec/exec.i or exec/initializers.i)
  108. >-> >
  109. >-> > Any Suggestions? (I really want to have these includes!)
  110. >->
  111. >-> First convert the .h files into .i files using the C preprocessor.
  112. >-> This will strip out crap that may confuse iconvert.  Then iconvert
  113. >-> your new files to .m files.  Note that I haven't actually done this
  114. >-> myself, but I have heard it works.  It's worth looking into at any
  115. >-> rate.
  116. >
  117. >Is/has anyone been able to do this? If so, are they going to post the 3.1 .m
  118. >files to this list, or make them available for others? 
  119.  
  120.     I converted asm includes v40.13 into Amiga E modules this week-end
  121. using IConvert. But I had a lot of problems with A68K/asm include format.
  122. I think I fixed them in 95% of the cases, but for the remaining 5%, I can't
  123. assure you that the conversion is perfect. Anyway, those problems are local
  124. to rarely used modules (like card.m).
  125.     I can e-mail them for each of you who want them (I prefer personal
  126. e-mail than a global e-mail to the list because the archive is quite big :-)).
  127. Simply e-mail me. If there are really too much demands for them, I'll e-mail
  128. them directly to the list.
  129.  
  130. >Apart from HowToCode 7,
  131. >are there any other docs on v39+? I've got the autodocs for v40 - but they
  132. >only cover the new libraries for the cd32...
  133.  
  134.     I have the v39 autodocs (so they exists :-)) but not the v40 :-(...
  135.  
  136.     Lionel
  137. From donews!crash!dcs.gla.ac.uk!mccracal Tue, 22 Feb 94 01:33:41 PST
  138. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  139.       id <1vvh@bkhouse.cts.com>; Tue, 22 Feb 94 01:33:41 PST
  140. Received: from crash by donews.cts.com with uucp
  141.     (Smail3.1.28.1 #18) id m0pYZMP-0002VDC; Mon, 21 Feb 94 07:03 EST
  142. Received: from vanuata.dcs.gla.ac.uk by crash.cts.com with smtp
  143.     (Smail3.1.28.1 #18) id m0pYYrk-0000TRC; Mon, 21 Feb 94 03:31 PST
  144. Received: from attu.dcs.gla.ac.uk by goggins.dcs.gla.ac.uk with LOCAL SMTP (PP) 
  145.           id <01573-0@goggins.dcs.gla.ac.uk>; Mon, 21 Feb 1994 11:31:36 +0000
  146. Received: by attu.dcs.gla.ac.uk (4.1/Dumb) id AA27888;
  147.           Mon, 21 Feb 94 11:31:32 GMT
  148. Date: Mon, 21 Feb 94 11:31:32 GMT
  149. Message-Id: <9402211131.AA27888@attu.dcs.gla.ac.uk>
  150. From: mccracal@dcs.gla.ac.uk
  151. To: AmigaE@bkhouse.cts.com
  152. Subject: Re: asl difficulties
  153.